package DesignPatterns.builderMode;

public class BicycleConcreteBuilder implements BicycleBuilder{
    Bicycle bicycle=new Bicycle();

    FrameConcreteBuilder frameConcreteBuilder;
    SaddleConcreteBuilder saddleConcreteBuilder;

    public BicycleConcreteBuilder(FrameConcreteBuilder frameConcreteBuilder, SaddleConcreteBuilder saddleConcreteBuilder) {
        this.frameConcreteBuilder = frameConcreteBuilder;
        this.saddleConcreteBuilder = saddleConcreteBuilder;
    }

    @Override
    public void Frame(String frame) {
       bicycle.setFrame(frameConcreteBuilder.material(frame).getMaterial());
    }

    @Override
    public void Saddle(String saddle) {
        bicycle.setSaddle(saddleConcreteBuilder.material(saddle).getMaterial());
    }

    @Override
    public Bicycle bicycle() {
        return bicycle;
    }
}
